<?
$traumatic_experiences = set_value('traumatic_experiences',$student->ce_trauma_exp_what);
$age_trauma = set_value('age_trauma',$student->ce_trauma_exp_age);
$trauma_reaction = set_value('trauma_reaction',$student->ce_trauma_exp_reaction);
$how_trauma_affected_child = set_value('how_trauma_affected_child',$student->ce_trauma_exp_affected);
$special_fears = set_value('special_fears',$student->ce_special_fears_what);
$when_what_triggered_fear = set_value('when_what_triggered_fear',$student->ce_special_fears_when);
$how_do_you_handle = set_value('how_do_you_handle',$student->ce_special_fears_handle);

//CHECK if value updated , if yes check if approve, denied  or pending
/*
 * Function located at parent_helper
 */

$profile_request = isset($profile_request) ? $profile_request : false;
$req_id = isset($req_id) ? $req_id : 0;

$is_traumatic_experiences = req_check_if_updated($req_id, 'ce_trauma_exp_what',$student->ce_trauma_exp_what, $profile_request);
$is_age_trauma = req_check_if_updated($req_id, 'ce_trauma_exp_age',$student->ce_trauma_exp_age, $profile_request);
$is_trauma_reaction = req_check_if_updated($req_id, 'ce_trauma_exp_reaction',$student->ce_trauma_exp_reaction, $profile_request);
$is_how_trauma_affected_child = req_check_if_updated($req_id, 'ce_trauma_exp_affected',$student->ce_trauma_exp_affected, $profile_request);
$is_special_fears = req_check_if_updated($req_id, 'ce_special_fears_what',$student->ce_special_fears_what, $profile_request);
$is_when_what_triggered_fear = req_check_if_updated($req_id, 'ce_special_fears_when',$student->ce_special_fears_when, $profile_request);
$is_how_do_you_handle = req_check_if_updated($req_id, 'ce_special_fears_handle',$student->ce_special_fears_handle, $profile_request);
?>
<div>
	<?=form_open('',' class="custom profile_form" id ="childhood_experiences" ')?>
	<div>
		<label class="radius secondary label">Has the child encountered ny traumatic experiances? if yes specify</label>  <?=$is_traumatic_experiences->checkbox?>
		<?=form_error('traumatic_experiences');?>
		<textarea class="<?=$is_traumatic_experiences->changed ? $is_traumatic_experiences->class : '' ?>" name="traumatic_experiences"><?=$traumatic_experiences;?></textarea>
	</div>
	<div>
		<div class="large-6 columns">
			<label class="radius secondary label">Age</label> <?=$is_age_trauma->checkbox?>
			<?=form_error('age_trauma');?>
			<input class="<?=$is_age_trauma->changed ? $is_age_trauma->class : '' ?>" type="text" name="age_trauma" value="<?=$age_trauma;?>">
		</div>
		<div class="large-6 columns">
			<label class="radius secondary label">Reaction</label> <?=$is_trauma_reaction->checkbox?>
			<?=form_error('trauma_reaction');?>
			<textarea class="<?=$is_trauma_reaction->changed ? $is_trauma_reaction->class : '' ?>" name="trauma_reaction"><?=$trauma_reaction;?></textarea>
		</div>
	</div>
	
	<div>
		<label class="radius secondary label">How has it affected the child?</label> <?=$is_how_trauma_affected_child->checkbox?>
		<?=form_error('how_trauma_affected_child');?>
		<textarea class="<?=$is_how_trauma_affected_child->changed ? $is_how_trauma_affected_child->class : '' ?>" name="how_trauma_affected_child"><?=$how_trauma_affected_child;?></textarea>
	</div>
	
	<div>
		<label class="radius secondary label">Does the child have any special fears?if yes what?</label> <?=$is_special_fears->checkbox?>
		<?=form_error('special_fears');?>
		<textarea class="<?=$is_special_fears->changed ? $is_special_fears->class : '' ?>" name="special_fears"><?=$special_fears;?></textarea>
	</div>
	<div>
		<label class="radius secondary label">Since when? What has triggered the fear?</label> <?=$is_when_what_triggered_fear->checkbox?>
		<?=form_error('when_what_triggered_fear');?>
		<textarea class="<?=$is_when_what_triggered_fear->changed ? $is_when_what_triggered_fear->class : '' ?>" name="when_what_triggered_fear"><?=$when_what_triggered_fear;?></textarea>
	</div>
	<div>
		<label class="radius secondary label">How do you handle it?</label> <?=$is_how_do_you_handle->checkbox?>
		<?=form_error('how_do_you_handle');?>
		<textarea class="<?=$is_how_do_you_handle->changed ? $is_how_do_you_handle->class : '' ?>" name="how_do_you_handle"><?=$how_do_you_handle;?></textarea>
	</div>
	<?/*if(isset($student->edit) && $student->edit === 1):?>
		<div>
			<input type="hidden" name="profile_id" value="<?=$student->profile_id;?>">
			<input type="hidden" name="enrollment_id" value="<?=$student->enrollment_id;?>">
			<input type="hidden" name="update_childhood_experiences" value="true">
			<input type="submit" name="update_childhood_experiences" value="Update Childhood Experiences"  class="btn btn-primary">
		</div>
	<?endif;*/?>
	</form>
</div>